<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>选择人员</title>
		<link href="/SCMDB/style/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/SCMDB/js/Super.js"></script>
		<%@ include file="../commonPage/message.jsp"%>
		
		<script type="text/javascript">
        function flickcheckStates(obj)
        {
            var accounts = document.getElementsByName("selAccount");
            if(accounts != null && typeof(accounts) != "undefined")
            {
            
                if(obj.innerHTML == "全选")
                {
                    for(var i = 0; i < accounts.length; i++)
                    {
                        if(!accounts[i].checked)
                        {
                            accounts[i].checked = true;
                        }
                    }
                    
                    obj.innerHTML = "清除";
                }
                else
                {
                    for(var i = 0; i < accounts.length; i++)
                    {
                         if(accounts[i].checked)
                         {
                            accounts[i].checked = false;
                         }
                    }
                    
                    obj.innerHTML = "全选";
                }
             }
        }
    </script>
	</head>
	<body>
		<h2>选择人员</h2>
		<s:form action="employeeAction!findEmployeeList" method="post" theme="simple">
		
			<div class="main">
				
					<table border="0" cellspacing="0" cellpadding="0" class="tableList" style="width:500px;">
						<tr>
							<td align="right" class="p_8">
								姓名：<s:textfield name="entity.empName" cssClass="sInput" cssStyle="width:100px;" />
								卡号：<s:textfield name="entity.empLabelID" cssClass="sInput" cssStyle="width:100px;" />
							</td>
							<td align="right" class="p_14" colspan="2"><s:submit value="查询" cssClass="bSearch" /></td>
						</tr>
			    	</table>
				
				<table border="0" cellpadding="1" cellspacing="1" class="tableList" style="width:500px;">
					<thead>
						<tr>
							<th width="5%" align="center">
								<span id="selStats" style="cursor:pointer" onclick="flickcheckStates(this)">全选</span>
							</th>
							<th width="5%">序号</th>
							<th width="10%">姓名</th>
							<th width="16%">单位名称</th>
						</tr>
					</thead>

					<tbody>
						<s:iterator id="emp" value="entity.list" status="u">
							<tr>
								<td><input type="checkbox" name="selAccount" id="${emp.id}" value="${emp.id}|${emp.empName}" /></td>
								<td class="number">${entity.index+u.index}</td>
								<td>${emp.empName}</td>
								<td>${emp.unitName}</td>
							</tr>
						</s:iterator>
						<tr>
							<td colspan="4" class="turnPage">
								<jsp:include flush="true" page="../commonPage/page.jsp">
									<jsp:param name="entity" value="entity" />
								</jsp:include>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</s:form>
	</body>
</html>
